<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	{{--<meta name="viewport" content="width=device-width, initial-scale=1">--}}
	<title>木投网--登录</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_login.css">
</head>
<body>
<div class="login-head">
	<div class="main">
		<div class="logo">
			<a href="/"><img src="/resource/img/logo.png" alt=""></a>
			<span>欢迎登录</span>
		</div>
	</div>
</div>
<div class="login-body">
	<div class="bg">
		<img src="/resource/img/login_bg.jpg" alt="">
		<div class="main">
			<!-- 登录窗口 -->
			<div class="popup-login">
				<div class="popup-bg">
					<div class="login-tit">
						会员登录
					</div>
					<form action="/verify_login" class="form" onsubmit="return check_all()" method="post">
						<div class="form-group">
							<label for="">手机号</label>
							<input type="text" class="form-control" id="username" name="username">
							<i class="i i-tel"></i>
						</div>
						<div class="form-group">
							<label for="">密码</label>
							<input type="password" class="form-control" id="pwd" name="password">
							<i class="i i-pass"></i>
							<a href="/retrieve_pass">找回密码</a>
							<span id="t_pwd">手机号或密码错误</span>
						</div>
						<input type="hidden" value="login" name="index">
						<div class="form-group form-left">
							<input type="checkbox" checked> 自动登录
						</div>
						<div class="form-group">
							<button type="submit" class="btn-login">登&#160&#160&#160录</button>
							<a href="/register" class="a-resgin">免费注册</a>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>	
</div>
<div class="login-foot main">
	<div class="foot-info">
		<ul>
			<li><a href="javascript:;">关于我们</a><span>|</span></li>
			<li><a href="javascript:;">法律声明</a><span>|</span></li>
			<li><a href="javascript:;">诚聘英才</a><span>|</span></li>
			{{--<li><a href="javascript:;">投资洽谈</a><span>|</span></li>--}}
			<li><a href="javascript:;">联系我们</a><span></span></li>
			{{--<li><a href="javascript:;">常见问题</a></li>--}}
		</ul>
		<p>北京木投网科技有限公司 京ICP备15043001   Copyright © 2016  Mutouw.com 版权所有</p>
	</div>
</div>
</body>
</html>
<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script>
	//验证用户名
	/*function check_username(){
	 var username = document.getElementById('username').value;
	 var status = false
	 if(username){
	 var ajax = new XMLHttpRequest();
	 ajax.onreadystatechange = function () {
	 if (ajax.readyState == 4) {
	 if (ajax.responseText == 0) {
	 document.getElementById("t_username").innerHTML = "用户名不存在";
	 } else {
	 document.getElementById("t_username").innerHTML = "";
	 status = true
	 }
	 }
	 }
	 //与服务器建立连接
	 ajax.open('post', '/js_verify_login', false);
	 ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	 //处理请求
	 ajax.send('username=' + username);
	 return status
	 }else{
	 document.getElementById('t_username').innerHTML = "用户名不能为空";
	 return false
	 }
	 }*/
	//验证密码
	/*	function check_pwd()
	 {
	 var pwd	= document.getElementById('pwd').value
	 if(pwd){
	 document.getElementById('t_pwd').innerHTML = '';
	 return true;
	 }else{
	 document.getElementById('t_pwd').innerHTML = '密码不能为空';
	 return false;
	 }
	 }*/

	function check_all()
	{
		var pwd	= document.getElementById('pwd').value
		var username = document.getElementById('username').value;
		$("#t_pwd").show();
		var status = false;
		if(pwd) {
			document.getElementById('t_pwd').innerHTML = '';
			if (username) {
				var ajax = new XMLHttpRequest();
				ajax.onreadystatechange = function () {
					if (ajax.readyState == 4) {
						if (ajax.responseText == 0) {
							$("#t_pwd").html("用户名或密码密码有误");
						}else if(ajax.responseText == 2){
							document.getElementById("t_pwd").innerHTML = '密码错误次数过多,请10分钟后登录';
						}else if(ajax.responseText == 1){
							$("#t_pwd").hide();
							status = true;
						}

					}
				}
				//与服务器建立连接
				ajax.open('post', '/js_verify_login', false);
				ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				ajax.send('username=' + username + "&pwd=" + pwd);
				return status;
			}
		}
		return status
	}
</script>